package cn.zyl.demo.undertow.tests;

import io.undertow.servlet.api.ClassIntrospecter;
import io.undertow.servlet.api.InstanceFactory;
import io.undertow.servlet.util.ConstructorInstanceFactory;

/**
 * JspClassInstance 类说明:参考<code>io.undertow.servlet.test.util.TestClassIntrospector</code>
 *
 * @author z.y.l
 * @version v1.0
 * @date 2020-09-07
 */
public class JspClassInstance implements ClassIntrospecter {
    public static final JspClassInstance INSTANCE = new JspClassInstance();
    public JspClassInstance() { }
    @Override
    public <T> InstanceFactory<T> createInstanceFactory(Class<T> clazz) throws NoSuchMethodException {
        return new ConstructorInstanceFactory(clazz.getDeclaredConstructor());
    }
}
